import React, {Component} from 'react';
import {Modal} from 'antd';
import GameInfoForm from './GameInfoForm';


class GameInfoModal extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        let maskClosable = false;
        let action = this.props.action;
        return (
            <div>
                <Modal key={this.props.newRandomKey} visible={this.props.visible} title={this.props.title}
                       maskClosable={maskClosable} onOk={() => this.props.saveGameInfo(action)}
                       onCancel={this.props.handleCancel}>
                    <GameInfoForm ref={this.props.saveFormRef} gameInfo={this.props.gameInfo}
                                  gameTypeInfo={this.props.gameTypeInfo}/>
                </Modal>
            </div>
        )
    }
}

export default GameInfoModal;